refactor(channel): simplify channel structure - #234
Merged
Conversation
This was referenced Aug 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
oneshot,mpsc,broadcast, andwatchsource modules to match their root public modules while preserving every public import pathWaitSetfan-out when one wake callback panics, apply the shared wake path to watch, broadcast, barriers, and countdown primitives, and cover the regression at both the internal and watch API boundariesreceiver_countinspection APIs from watch and broadcast, simplify endpoint decrements while retaining checked endpoint growth and version increments, and remove implementation-only overflow testsbuffer_lenand receiverleninspection methods withretained_message_countandunread_message_count, and remove the redundant receiveris_emptyDesign Notes
The shared wake helper adds no
catch_unwindcall to the normal path. It owns the remaining iterator through a drop guard; if one callback panics, the guard attempts every later wake while suppressing secondary panics, then lets the original panic continue.Endpoint growth remains checked because wrapping a live sender or receiver count would corrupt disconnection detection. Drops use direct subtraction because each successfully constructed sender or receiver contributes exactly one decrement. Future shared ring, sequencer, or Disruptor machinery can live under
internalwithout restoring a privatechannelsource layer.Broadcast inspection names describe their measurement scope directly:
retained_message_countreports the shared backlog kept alive by the slowest active receiver, whileunread_message_countreports the backlog visible to one receiver. Both are instantaneous snapshots rather than synchronization guarantees.Follow-up to #233.